/*******************************************************************************************************

Table A9: Controlling for Tilly's measures of public protest

*******************************************************************************************************/


*Set directory path
cd "C:\Users\tsa23\Documents\petitions\replication files"

clear all

*read in our main dataset
use dta\didtilly1_rep.dta /// dataset with events with circle of same radius as the constituency


*Elminate contrituencies which are not part of Treatment G
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if new == 1 | drummond == .

gen treatgroup = 0
replace treatgroup =  1 if new==1 

gen treatinter = treatperiod*treatgroup

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"

gen logPNUM_all  = log(PNUM_all  + 1)
label var logPNUM_all "Log people (all)"
label var event_all "Events (all)"

reg ln_petitions  treatinter treatgroup treatperiod   logPNUM_all , cl(ID)  
outreg2 treatinter treatgroup treatperiod   logPNUM_all event_all using results\tableA9, replace addt(Scale, 1, Treatment, G) asterisk(coef) auto(2) label ctitle(Log(petitions+1)) cttop(Treatment G) keep(treatinter treatgroup treatperiod   logPNUM_all event_all) se  symbol(**,*,+) nocons tex(frag)

reg ln_petitions treatinter treatgroup treatperiod   event_all, cl(ID)
outreg2 treatinter treatgroup treatperiod   logPNUM_all event_all using results\tableA9, append addt(Scale, 1, Treatment, G) asterisk(coef) auto(2) label ctitle(Log(petitions+1)) cttop(Treatment G) keep(treatinter treatgroup treatperiod   logPNUM_all event_all) se  symbol(**,*,+) nocons tex(frag)


clear all

*read in our main dataset
use dta\didtilly2_rep.dta /// dataset with events with circle of twice the radius as the constituency


*Elminate contrituencies which are not part of Treatment L
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if sch_A==1 | sch_B == 1 | drummond!=.

gen treatgroup = 0
replace treatgroup =  1 if sch_A==1 

gen treatinter = treatperiod*treatgroup

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"

gen logPNUM_all  = log(PNUM_all  + 1)
label var logPNUM_all "Log people (all)"
label var event_all "Events (all)"

reg ln_petitions  treatinter treatgroup treatperiod   logPNUM_all , cl(ID)  
outreg2 treatinter treatgroup treatperiod   logPNUM_all event_all using results\tableA9, append addt(Scale, 2, Treatment, L) asterisk(coef) auto(2) label ctitle(Log(petitions+1)) cttop(Treatment L) keep(treatinter treatgroup treatperiod   logPNUM_all event_all) se  symbol(**,*,+) nocons tex(frag)

reg ln_petitions treatinter treatgroup treatperiod   event_all, cl(ID)
outreg2 treatinter treatgroup treatperiod   logPNUM_all event_all using results\tableA9, append addt(Scale, 2, Treatment, L) asterisk(coef) auto(2) label ctitle(Log(petitions+1)) cttop(Treatment L) keep(treatinter treatgroup treatperiod   logPNUM_all event_all) se  symbol(**,*,+) nocons tex(frag)

